package com.xuecheng.learning.service;

import com.xuecheng.api.learning.model.dto.CourseRecordDTO;
import com.xuecheng.api.learning.model.vo.ResourceUrlModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.learning.entity.CourseRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 选课记录 服务类
 * </p>
 *
 * @author itcast
 * @since 2021-05-21
 */
public interface CourseRecordService extends IService<CourseRecord> {

    /**
     * 查询用户某课程记录
     *
     * @param coursePubId
     * @return
     */
    CourseRecordDTO getCourseRecordByCoursePuId(Long coursePubId, String userName);

    /**
     * 创建或修改课程学习记录数据
     *
     * @param dto
     * @return
     */
    CourseRecordDTO createOrModifyRecord(CourseRecordDTO dto);

    /**
     * 根据课程发布Id、课程计划Id、媒资信息Id、用户名获得视频播放信息
     *
     * @param coursePubId
     * @param teachplanId
     * @param mediaId
     * @param userName
     * @return
     */
    ResourceUrlModel playUrl(Long coursePubId, Long teachplanId, Long mediaId, String userName);

    /**
     * 查询用户课程记录列表(我的选课信息列表)
     *
     * @param params
     * @param userName
     * @return
     */
    PageVO<CourseRecordDTO> queryCourseRecordList(PageRequestParams params, String userName);

    /**
     * 查询课程学习人数
     * @param coursePubId
     * @param companyId
     * @return
     */
    List<CourseRecordDTO> recentLearnedUsers(Long coursePubId, Long companyId);
}
